package sgi.client;

import javax.swing.JFrame;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;

import javax.sql.rowset.*;
import com.sun.rowset.CachedRowSetImpl;

public class YearlyReport extends JFrame {

	public YearlyReport(CachedRowSetImpl reportInfo) throws SQLException {
		
		ArrayList<Integer> bought_images, bought_samples, new_images, new_samples;
		
		bought_images 	= new ArrayList<Integer>();
		bought_samples 	= new ArrayList<Integer>();
		new_images 		= new ArrayList<Integer>();
		new_samples		= new ArrayList<Integer>();
		
		while(reportInfo.next()) {
			bought_images.add(Integer.valueOf((reportInfo.getString(5))));
			bought_samples.add(Integer.valueOf((reportInfo.getString(6))));
			new_images.add(Integer.valueOf((reportInfo.getString(7))));
		}
		
		while (bought_images.size()<7)
			bought_images.add(0);
		while (bought_samples.size()<7)
			bought_samples.add(0);
		while (new_images.size()<7)
			new_images.add(0);
			
		
		Collections.sort(bought_images);
		Collections.sort(bought_samples);
		Collections.sort(new_images);
		
	}



}
